<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>WAF策略检测与绕过工具</title>
    <link href="https://cdn.bootcdn.net/ajax/libs/bootstrap/5.3.2/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.bootcdn.net/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="{{ url_for('static', filename='css/style.css') }}" rel="stylesheet">
</head>
<body>
    <nav class="navbar navbar-dark bg-dark">
        <div class="container-fluid">
            <span class="navbar-brand mb-0 h1">
                <i class="fas fa-shield-alt"></i> WAF策略检测与绕过工具
            </span>
        </div>
    </nav>

    <div class="container-fluid mt-4">
        <div class="row">
            <!-- 左侧配置面板 -->
            <div class="col-md-4">
                <div class="card">
                    <div class="card-header">
                        <h5><i class="fas fa-cog"></i> 配置选项</h5>
                    </div>
                    <div class="card-body">
                        <form id="wafForm">
                            <div class="mb-3">
                                <label for="targetUrl" class="form-label">目标URL</label>
                                <input type="url" class="form-control" id="targetUrl" 
                                       placeholder="https://example.com" required>
                            </div>
                            
                            <div class="mb-3">
                                <label for="payloads" class="form-label">测试Payload</label>
                                <textarea class="form-control" id="payloads" rows="6" 
                                          placeholder="每行一个payload"></textarea>
                                <button type="button" class="btn btn-sm btn-secondary mt-1" 
                                        onclick="loadDefaultPayloads()">
                                    <i class="fas fa-list"></i> 加载默认Payload
                                </button>
                            </div>
                            
                            <button type="submit" class="btn btn-primary w-100">
                                <i class="fas fa-play"></i> 开始检测
                            </button>
                        </form>
                    </div>
                </div>

                <!-- 进度显示 -->
                <div class="card mt-3" id="progressCard" style="display: none;">
                    <div class="card-body">
                        <h6><i class="fas fa-spinner fa-spin"></i> 检测进度</h6>
                        <div class="progress">
                            <div class="progress-bar" role="progressbar" id="progressBar" 
                                 style="width: 0%">0%</div>
                        </div>
                        <small id="progressText" class="text-muted">准备中...</small>
                    </div>
                </div>
            </div>

            <!-- 右侧结果面板 -->
            <div class="col-md-8">
                <!-- WAF检测结果 -->
                <div class="card">
                    <div class="card-header">
                        <h5><i class="fas fa-search"></i> WAF检测结果</h5>
                    </div>
                    <div class="card-body" id="resultsContainer">
                        <div class="text-center text-muted">
                            <i class="fas fa-info-circle fa-3x"></i>
                            <p class="mt-3">请输入目标URL并开始检测</p>
                        </div>
                    </div>
                </div>

                <!-- 绕过测试结果 -->
                <div class="card mt-3">
                    <div class="card-header">
                        <h5><i class="fas fa-bug"></i> 绕过测试结果</h5>
                    </div>
                    <div class="card-body" id="bypassContainer">
                        <div class="text-center text-muted">
                            <i class="fas fa-shield-alt fa-3x"></i>
                            <p class="mt-3">绕过测试将在WAF检测后显示</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- 结果详情模态框 -->
    <div class="modal fade" id="detailModal" tabindex="-1">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title">详细信息</h5>
                    <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
                </div>
                <div class="modal-body" id="modalBody">
                    <!-- 动态内容 -->
                </div>
            </div>
        </div>
    </div>

    <script src="https://cdn.bootcdn.net/ajax/libs/bootstrap/5.3.2/js/bootstrap.bundle.min.js"></script>
    <script src="{{ url_for('static', filename='js/app.js') }}"></script>
</body>
</html>